package org.example.leetcode.common._enum;

public enum MailTypeEnum implements BaseEnum<String,String>{
    Login("1","login"),
    Register("2","register");
    private String code;
    private String name;
    private MailTypeEnum(String code,String name){
        this.code=code;
        this.name=name;
    }
    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getName() {
        return name;
    }
    public static String getByCode(String code){
        for(BaseEnum<String,String> _enum:MailTypeEnum.values()){
            if(_enum.getCode().equals(code)){
                return _enum.getName();
            }
        }
        return null;
    }
}
